﻿using Basic.HrGatewayModular.Interface;
using Basic.HrGatewayModular.Model.LoginUser;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Interface;

namespace Basic.HrGatewayModular.Api
{
    [ApiRouteName("/hr/LoginUser/{name}")]
    internal class UserResetPwdApi : ApiController
    {
        private readonly IPwdResetService _Service;

        public UserResetPwdApi ( IPwdResetService service )
        {
            this._Service = service;
        }
        [ApiPower(false)]
        public IResponse CreateCode ( [NullValidate("hr.login.name.null")][LenValidate("hr.login.name.len", 6, 20)] string name )
        {
            return this._Service.CreateCode(name);
        }
        [ApiPower(false)]
        public void ResetUserPwd ( UIResetPwdArg obj )
        {
            this._Service.ResetUserPwd(obj, base.Request.ClientIp);
        }
    }
}
